home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / util / rexx / rmh.lha / rmh / examples / cx.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2000-11-28  |  697 b   |  37 lines

  1. /* */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4.  
  5. name   = "rmhCx"
  6. text   = "rmhCx 1.0 <alfier@iol.it>"
  7. descr  = "Cx in ARexx by rmh.library"
  8. flags  = "UNIQUE NOTIFY DISKINSERTED DISKREMOVED"
  9. hotkey = "rawkey control esc"
  10. cx=AddCx(name,text,descr,flags,hotkey)
  11. if cx=0 then do
  12.     say "unique violation"
  13.     exit
  14. end
  15. if cx=1 then do
  16.     say "bad hotkey description"
  17.     exit
  18. end
  19. cxs=CxSignal(cx)
  20.  
  21. do while 1
  22.     rsig=Wait(or(cxs,2**12))
  23.     if and(rsig,2**12)~=0 then exit
  24.     if and(rsig,cxs)~=0 then call handle(cx)
  25. end
  26. exit
  27.  
  28. handle:
  29. parse arg cx
  30.     handle.wait=0
  31.     num=HandleCx(cx,"HANDLE")
  32.     do i=0 to num-1
  33.         say pragma(id) i handle.i.class
  34.         if handle.i.class=="KILL" then exit
  35.     end
  36.     return
  37.